package g

import (
	"fmt"
	"testing"
	"time"
)

func Test_mySqrt(t *testing.T) {
	type args struct {
		x int
	}
	tests := []struct {
		name string
		args args
		want int
	}{
		{"0", args{0 * 0}, 0},
		{"1", args{1 * 1}, 1},
		{"2", args{2 * 2}, 2},
		{"3", args{3 * 3}, 3},
		{"4", args{4 * 4}, 4},
		{"5", args{5 * 5}, 5},
		{"6", args{6 * 6}, 6},
		{"7", args{7 * 7}, 7},
		{"8", args{8 * 8}, 8},
		{"9", args{9 * 9}, 9},
		{"10", args{10 * 10}, 10},
		{"11", args{11 * 11}, 11},
		{"12", args{12 * 12}, 12},
		{"13", args{13 * 13}, 13},
	}
	start := time.Now()
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if got := mySqrt(tt.args.x); got != tt.want {
				t.Errorf("mySqrt() = %v, want %v", got, tt.want)
			}
		})
	}
	fmt.Println(time.Since(start))
}
